﻿package com.dykj.platform.framework.dao.hibernate;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.springframework.jdbc.core.JdbcTemplate;

import com.dykj.platform.framework.common.paging.Page;
import com.dykj.platform.framework.dao.IDBAccess;
import com.dykj.platform.framework.exception.DatabaseException;

/**
 * @Title: DYKJ Platform
 * @Description: Hibernate查询数据访问接口
 * @Copyright: Copyright (c) 2008
 * @Company: DYKJ
 * @author jit@dykj.cn
 * @version 1.0
 */
public interface IHibernateDBAccess extends IDBAccess {
	public abstract void save(Object obj) throws DatabaseException;

	public abstract void update(Object obj) throws DatabaseException;

	public abstract void saveOrUpdate(Object obj) throws DatabaseException;

	public abstract void delete(Object obj) throws DatabaseException;

	public abstract int getCount(String s) throws DatabaseException;

	public abstract int getCount(String s, List param)
			throws DatabaseException;

	public abstract Object getObject(Class class1, Serializable serializable)
			throws DatabaseException;
	public abstract Object loadObject(Class class1, Serializable serializable)
			throws DatabaseException;
	
	public abstract List query(String s) throws DatabaseException;

	public abstract List query(String s, List param)
			throws DatabaseException;

	public abstract List query(Object obj) throws DatabaseException;

	public abstract List pageQuery(String s, int i, int j)
			throws DatabaseException;

	public abstract List pageQuery(Object obj, int i, int j)
			throws DatabaseException;

	public abstract List pageQuery(String s, Page page)
			throws DatabaseException;

	public abstract List pageQuery(String s, List param, int i, int j)
			throws DatabaseException;

	public abstract List pageQuery(String s, List param, Page page)
			throws DatabaseException;

	public abstract Session getSession() throws DatabaseException;

	public abstract String getSequence(String s) throws DatabaseException;

	public abstract int beginTransaction() throws DatabaseException;

	public abstract void commit(int i) throws DatabaseException;

	public abstract void rollback() throws DatabaseException;

	public abstract int execDML(String s) throws DatabaseException;

	public abstract int execDML(String s, List param)
			throws DatabaseException;

	public abstract List callProcedure(String s, Object aobj[], int ai[],
			boolean flag) throws DatabaseException;

	public abstract List queryNamed(String s, List param)
			throws DatabaseException;

	public abstract List queryNamed(String s) throws DatabaseException;

	public abstract JdbcTemplate getJdbcTemplate() throws DatabaseException;
	
	public List pageJdbcQuery(String sql, int firstResult,int maxResults) throws DatabaseException ;
	
	public int getJdbcCount(String sql) throws DatabaseException ;
	
	public List queryJDBC(String sql) throws DatabaseException;
	
	public String execSQL(String sql);
}
